package com.ruoyi.system.service.assets.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.assets.FzBuildingRoomType;
import com.ruoyi.system.mapper.assets.FzBuildingRoomTypeMapper;
import com.ruoyi.system.service.assets.IFzBuildingRoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * 房屋类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-02-28
 */
@Service
public class FzBuildingRoomTypeServiceImpl implements IFzBuildingRoomTypeService
{
    @Autowired
    private FzBuildingRoomTypeMapper fzBuildingRoomTypeMapper;

    /**
     * 查询房屋类型
     * 
     * @param id 房屋类型ID
     * @return 房屋类型
     */
    @Override
    public FzBuildingRoomType selectFzBuildingRoomTypeById(Long id)
    {
        return fzBuildingRoomTypeMapper.selectFzBuildingRoomTypeById(id);
    }

    /**
     * 查询房屋类型列表
     * 
     * @param fzBuildingRoomType 房屋类型
     * @return 房屋类型
     */
    @Override
    public List<FzBuildingRoomType> selectFzBuildingRoomTypeList(FzBuildingRoomType fzBuildingRoomType)
    {
        return fzBuildingRoomTypeMapper.selectFzBuildingRoomTypeList(fzBuildingRoomType);
    }

    /**
     * 新增房屋类型
     * 
     * @param fzBuildingRoomType 房屋类型
     * @return 结果
     */
    @Override
    public int insertFzBuildingRoomType(FzBuildingRoomType fzBuildingRoomType)
    {
        fzBuildingRoomType.setCreateTime(DateUtils.getNowDate());
        return fzBuildingRoomTypeMapper.insertFzBuildingRoomType(fzBuildingRoomType);
    }

    /**
     * 修改房屋类型
     * 
     * @param fzBuildingRoomType 房屋类型
     * @return 结果
     */
    @Override
    public int updateFzBuildingRoomType(FzBuildingRoomType fzBuildingRoomType)
    {
        return fzBuildingRoomTypeMapper.updateFzBuildingRoomType(fzBuildingRoomType);
    }

    /**
     * 删除房屋类型对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzBuildingRoomTypeByIds(String ids)
    {
        return fzBuildingRoomTypeMapper.deleteFzBuildingRoomTypeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除房屋类型信息
     * 
     * @param id 房屋类型ID
     * @return 结果
     */
    @Override
    public int deleteFzBuildingRoomTypeById(Long id)
    {
        return fzBuildingRoomTypeMapper.deleteFzBuildingRoomTypeById(id);
    }
}
